#include "lock_thread_safe_queue.h"
#include <iostream>

std::mutex mt;

class ABC{
public:
    int * a;
public:
    ABC(){
        a = new int[1];
        *a = 1;
    }
    ~ABC(){
        if(a == NULL)
            delete []a;
        a = NULL;
    }
};

std::unique_ptr<ABC> ret_ABC(){
    std::unique_ptr<ABC> p(new ABC());
    return p;
}

int main(){
    thread_safe_queue<int> queue;
    for(int i = 0; i < 10; ++i)
        queue.push(i);
    
    queue.try_pop();

    queue.try_pop();
    queue.try_pop();
    queue.try_pop();

    std::unique_ptr<ABC> p = ret_ABC();

    std::cout << *(p.get()->a) << std::endl;

    return 0;
}